home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / pmgb32.arj / SPIN.PMG < prev    next >
Text File  |  1993-05-23  |  1KB  |  29 lines

  1. /* Spin the globe with sun position held static */
  2. /* (Note: currently this 'undoes' positions set interactively while */
  3. /* running; fixing this is left as an exercise for the reader.)     */
  4.  
  5. "extract title"                         /* save current title */
  6. signal on halt
  7.  
  8. 'set title PMGlobe - Slow spin'         /* new title */
  9. 'extract viewlat viewlon sunlat sunlon' /* get current */
  10. offlat=sunlat-viewlat                   /* relative sun latitude  */
  11. offlon=sunlon-viewlon                   /* relative sun longitude */
  12.  
  13. do forever                              /* (Use Halt Macro to end) */
  14.   'wait +0:05'                          /* redraw every 5 minutes */
  15.   'extract sunlat sunlon'               /* get new sun position */
  16.   lon=sunlon-offlon                     /* calculate new view lon */
  17.   if lon<-180 then lon=lon+360          /* if wrapped past dateline.. */
  18.    else if lon>180 then lon=lon-360     /* .. adjust as needed */
  19.   'set viewlon' lon                     /* new longitude */
  20.   lat=sunlat-offlat                     /* calculate new view lat */
  21.   if lat<-90 then lat=-lat-180          /* if wrapped over a pole.. */
  22.    else if lat>90 then lat=180-lat      /* .. adjust as needed */
  23.   'set viewlat' lat                     /* .. and set */
  24.   end
  25.  
  26. halt:  /* Restore setting(s) we altered */
  27. "SET TITLE" title
  28. exit
  29.